package cn.lanqiao.blog.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.lanqiao.blog.entity.Lable;
import cn.lanqiao.blog.service.LableService;
import cn.lanqiao.blog.utils.Result;
@CrossOrigin
@RestController
@RequestMapping("lable")
public class LableController {
	
	@Autowired
	private LableService lableService;

	@RequestMapping("getAllLables")
	public Result getAllLables(){
		return Result.success(lableService.getAllLables());
	}
	@RequestMapping("/get")
	public Result getAll(){
		return Result.success(lableService.getAll());
		
	}
	
	@RequestMapping("/insert")
	public Result insertLable(Lable lable) {
		return Result.success(lableService.insertLable(lable));
	}
	
	@RequestMapping("/update")
	public Result updateLable(Lable lable) {
		return Result.success(lableService.updateLable(lable));
		
	}
	
	@RequestMapping("/delete")
	public Result deleteLable(Integer id) {
		return Result.success(lableService.deleteLable(id));
		
	}
}
